//校验权限
import router from './router/router'
import { Notify } from 'vant'

router.beforeEach((to, from, next) => {
  let token = localStorage.getItem('token')
  if(!token){
    if(to.path === '/userinfo'){
      Notify({ type: 'warning', message: '请先登录'})
      next({path: '/login'})
    }else{
      next()
    }
  }else{
    next()
  }
})
